package com.bowen.demo.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * <h3>java-study</h3>
 * <p>堆内存溢出</p>
 * @author : zhang.bw
 * @date : 2021-03-25 10:43
 **/
public class HeapOomError {
	public static void main(String[] args){
		List<byte[]> list = new ArrayList<>();
		int i=0;
		while(true){
			list.add(new  byte[5 * 1024 *1024]);
			System.out.println("count is:"+(++i));
		}
	}
}
